package utils

import (
	"github.com/sirupsen/logrus"
	"io"
	"os"
)

func Logger() *logrus.Logger {
	var logger = logrus.New()
	//设置日志登记
	logrus.SetLevel(logrus.InfoLevel)
	logrus.SetFormatter(&logrus.JSONFormatter{
		TimestampFormat: "2006-01-02 15:04:05.000",
	})

	logrus.WithFields(logrus.Fields{
		"project": "my-gin",
	})

	logrus.SetOutput(io.MultiWriter(os.Stdout))

	return logger

}
